/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.response;

/**
 * 
 * @author haolw
 * @time 2018/03/12
 */
public class AlipayProviderSignGrantResponse {
	private String prefix = "<script type='text/javascript'>";
	private String suffix = "</script>";
	private String result;

	public AlipayProviderSignGrantResponse() {
		success();
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public void noConfigError() {
		String msg = "查找不到相关授权信息！";
		setResult(combin(msg));
	}

	public void authError() {
		String msg = "授权失败！";
		setResult(combin(msg));
	}

	public void authNotmatch() {
		String msg = "授权商户号不匹配！";
		setResult(combin(msg));
	}

	public void success() {
		String msg = "授权成功！";
		setResult(combin(msg));
	}

	private String combin(String txt) {
		String msg = "alert('" + txt + "')";
		return prefix.concat(msg).concat(suffix);
	}
}
